<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE HTML >
<html>
<meta charset="utf-8">
  <head>
    
    <title>My JSP 'index.jsp' starting page</title>
	<link rel="stylesheet" type="text/css" href="image/style.css">
	<link rel="stylesheet" href="jquery/jquery.ui.all.css">
	<script src="jquery/jquery-1.7.2.js"></script>
	<script src="jquery/jquery.ui.core.js"></script>
	<script src="jquery/jquery.ui.widget.js"></script>
	<script src="jquery/jquery.ui.tabs.js"></script>
	<link rel="stylesheet" type="text/css" href="image/tabs-1.css">
	<link rel="stylesheet" type="text/css" href="image/waimai_billcss.css">
	<script type="text/javascript" src="image/tabs.js"></script>
	<link rel="stylesheet" href="jquery/demos.css">
	<script type="text/javascript">
	$(function() {
		$( "#waimai_middle_tabs" ).tabs({
			event:'click'
		});
	
	});
	
	</script>
	<script type="text/javascript">
	function diancan(index){
	
	var text1=0.0;
	var caiming=index.id;
	var jiage=index.name;
    var doc=document.getElementById("dingcan_qingdan").getElementsByTagName("table")[0];
    var doc1=document.getElementById("dingcan_qingdan").getElementsByTagName("tr")[0];
    var doc2=document.getElementById("dingcan_qingdan");
    var table=document.getElementById("table3");
    var rows=table.rows;

    var tr=document.createElement("tr");
    var td=document.createElement("td");
    var td1=document.createElement("td");
    var td2=document.createElement("td");
    var td3=document.createElement("td");
    var td4=document.createElement("td");
    var input=document.createElement("input");
    var input1=document.createElement("input");
    var input2=document.createElement("input");
    var input3=document.createElement("input");
    var button=document.createElement("input");
     
     td.appendChild(input);
     
     td1.appendChild(input1);
     td.appendChild(input2);
     
     td1.appendChild(input3);
     input2.value=caiming;
     input3.value=jiage;
     input2.type="hidden";
     input3.type="hidden";
     input2.name="caiming";
     input3.name="jiage";
     input.value=caiming;
    input.type="text";
    //input.name="caiming";
    input.disabled=true;
    input1.type="text";
    input1.disabled=true;
    //input1.name="jiage";
    input1.value=jiage;
    td2.appendChild(document.createTextNode("清楚"));
    td3.appendChild(document.createTextNode("1"));
    td4.appendChild(document.createTextNode("*"));
    //zongjia.appendChild(document.createTextNode("总价："+text1));
    tr.appendChild(td);
    tr.appendChild(td1);
    tr.appendChild(td3);
    tr.appendChild(td4);
    doc1.appendChild(td2);
    doc.appendChild(tr);
    //doc2.appendChild(zongjia);
    	 for(var i=1;i<rows.length;i++){
    
    var cells=table.cells;
    
       
    text=rows[i].cells[1].getElementsByTagName("input")[0].value;
text1=parseFloat(text)+parseFloat(text1);
   
   
    }
    var zongjia=document.createElement("span");
    button.type="submit";
    button.value="总价："+text1;
    button.id="button";
    
    doc2.appendChild(button);
	 doc1.removeChild(doc1.childNodes[3]);
	 doc2.removeChild(doc2.childNodes[2]);
	

     
	}
	</script>
  </head>
  <body>

<div class="waimai_top">
    <div class="waimai_top_header">
  <table id="table1">
  <tr>
      <td>你好，欢迎来到waimai！</td>
      <td>注册</td>
      <td>登录</td>
  </tr>
  </table>
  <table id="table2" >
  <tr>
      <td>我的订单</td>
      <td>我的waimai！</td>
  </tr>
  </table>
  </div>
  </div>
    <br><hr>
<%
String name=request.getParameter("i");

 %>
 <div class="waimai_body">
<div class="waimai_middle">
<div class="waimai_middle_header">
<div class="waimai_middle_header1"><img src="image/1.jpg"></div>
<div class="waimai_middle_header2"><span><b><% if(name==null){name="嘉应学院（本部）";out.println(name);} else{out.println(name);}%></b><a href="address.html">[切换位置]</a></span></div>
<div class="waimai_middle_header3">
<form action="">
<ul><li><font size="5">搜菜名</font></li>
<li><input type="text" name="keyword" size="50" style="height:30px;"><input type="submit" value="搜索" style="height:30px;width:70px;"></li>

</ul>
</form>
</div>
</div>



<div id="waimai_middle_tabs">
	<ul>
	    <li style="display: none"><a href="#tabs1">外卖吧</a></li>
		<li><a href="#tabs6">外卖吧</a></li>
		<li><a href="#tabs2">当前特价</a></li>
		<li><a href="#tabs3">积分赠品</a></li>
		<li><a href="#tabs4">商家加盟</a></li>
		<li><a href="#tabs5">常见问题</a></li>
	</ul>
	<div id="tabs1" style="height:2000px;padding:0px;">
	
	
	<div id="dingcan_top">
	<% 
	String[] caiming1=request.getParameterValues("caiming");
	String[] jiage1=request.getParameterValues("jiage");
	if(caiming1==null||jiage1==null){}else{
	for(int i=0;i<caiming1.length;i++){
	out.print(caiming1[i]+":"+jiage1[i]);
     
	

	
	
	out.print("<br>");
	}}
	
	%>
	
	</div>
	<div id="dingcan_left">
	
	<ul>
	<li>看菜单</li>
	<li>留言</li>
	
	</ul>
	<div id="dingcan_caidan">
	<table>
	<tr><td>白饭</td><td>1.0元</td><td><input type="button" id="白饭" name="1.0" value="吃一份" onclick="diancan(this)"></td></tr>
	<tr><td>稀饭</td><td>1.0元</td><td><input type="button" id="稀饭" name="1.0" value="吃一份" onclick="diancan(this)"></td></tr>
	<tr><td>地瓜饭</td><td>2.0元</td><td><input type="button" id="地瓜饭" name="2.0" value="吃一份" onclick="diancan(this)"></td></tr>
	</table>
	</div>
	
	
	</div>
	<div id="dingcan_right">
	<ul><li>我的订单</li></ul>
	<form action="#" method="get">
	<div id="dingcan_qingdan">
	
	<table id="table3">
	<tr id="d"><td>菜名</td><td>单价</td><td>份数</td><td></td></tr>
	
	</table>
	
	</div>
	</form>
	</div>
	
	
	
	
	
	
	
	
	
	
	</div>
	<div id="tabs6" >
	
	<iframe src="index.jsp" width="1100px" height="2000px" style="margin-left:-20px">
	</iframe>
	
	
	
	</div>
	<div id="tabs2">
	<iframe src="index.jsp" width="1100px" height="2000px" style="margin-left:-20px">
	</iframe>
	</div>
	<div id="tabs3">
	<iframe src="index.jsp" width="1100px" height="2000px" style="margin-left:-20px">
	</iframe>
	</div>
	<div id="tabs4">
	<iframe src="index.jsp" width="1100px" height="2000px" style="margin-left:-20px">
	</iframe>
	</div>
	<div id="tabs5">
	<iframe src="index.jsp" width="1100px" height="2000px" style="margin-left:-20px">
	</iframe>
	</div>
	
</div>

</div>

 
  </div>
  
 
  </body>
</html>
